pdchisq
.Print and plotting methods for the PDchisq
object class returned by pdchisq
.
# S3 method for PDchisq
print(x, ...) # S3 method for PDchisq
plot(x, type="h", ylab="Pair-difference chi-squared", ylim=NULL, ...)
# S3 method for PDchisq
barplot(height, ylab="Pair-difference chi-squared", names.arg=names(height),
crit.vals=TRUE, lty.crit=c(2,1), col.crit=2, lwd.crit=c(1,2),
probs=c(0.95, 0.99), n=length(height), ylim=NULL, ... )
bootPDchisq(x, B=3000, probs=c(0.95, 0.99),
method=c("rnorm", "lhs"), keep=FALSE, labels=names(x), ...)
The print
method returns the object, invisibly.
The plot
method returns NULL, invisibly.
The barplot
method returns the values at the midpoint of each bar.
bootPDchisq
returns an object of class "bootMtrPairs"
; see
bootMtrPairs-class
for details.
Object of class "PDchisq"
.
The plot type. See plot.default
.
Label for vertical axis, passed to barplot
Labels for individual bars in bar plot, passed to barplot
. If names(height)
is NULL
, bars are numbered.
If TRUE
, horizontal lines at critical values are added to the plot.
These are calculated from link{qchisq}
based on supplied values of
probs
and n
.
Vectors of line style parameters for plotted critical values, passed to
segments
. Recycled to the length of critical.values
in the supplied bootPDchisq
object.
vector of probabilities at which critical values are drawn (or, for the bootstrap, calculated and retained.
integer number of observations (NOT degrees of freedom) for critical value
calculation; used (as \(n-1\)) by qchisq
. See Details.
integer number of bootstrap replicates; passed to boot.mtr.pairwise
.
Limits for y-axis. the default makes sure the axis begins at zero and includes all values
simulation method; passed to boot.mtr.pairwise
.
logical, indicating whether to retain simulated values.
Passed to boot.mtr.pairwise
.
labels for returned object; passed to boot.mtr.pairwise
.
Parameters passed to other methods.
S. L. R. Ellison s.ellison@lgcgroup.com
See pdchisq
for the “PDchisq” object description.
The quantiles plotted by the barplot method are based on qchisq
,
divided by \(n-1\).
Note that this assumes independence and is at best a guide; for more accurate
quantiles, see bootPDchisq
For the barplot method, the default critical values are ‘single-observation’
quantiles. For use as an outlier test, use probabilities adjusted for multiple comparison;
for example, consider raising the default probs
to the power \(1/n\).
Specifying n
directly is principally intended for when the plotted values are not
the whole set of pair-difference chi-squared values calculated from a given data set.
However, it can also be useful for limiting cases. Where a
single value has very small uncertainty \(s\), its pair-difference chi-squared
is distributed approximately as \(\chi^2(n-1)\). At the other
extreme, if a single value has very large uncertainty \(s\) compared to others,
its pair-difference chi-squared is distributed approximately as \(\chi^2(1)\).
bootPDchisq
generates a parametric bootstrap (Monte carlo simulation)
from an object of class "PDchisq"
. This provides a case-specific test
of the null that all mean values are equal, with the uncertainties and/or
covariances accurate. bootPDchisq
is a wrapper for
boot.mtr.pairwise
, which provides further information.
pdchisq
, qchisq
, bootMtrPairs-class
.
data(Pb)
pdchisq.Pb<-pdchisq(Pb$value, Pb$u) # Uses individual standard uncertainties
names(pdchisq.Pb) <- as.character(Pb$lab)
plot(pdchisq.Pb)
barplot(pdchisq.Pb)
Run the code above in your browser using DataLab